#include <QDebug>

int main(int argc, char *argv[])
{
    QMap<QString, QString> map;
    map.insert("beijing","111");
    map.insert("shanghai","021");
    map.insert("jinan","0531");
 #if 0
    map.insert("nanjing","025");
    QMapIterator<QString,QString> i (map);
    for(; i.hasNext();)
    {
        qDebug() << " " << i.key() << " " << i.next().value();
    }

    QMutableMapIterator<QString,QString> mi(map);
    if(mi.findNext("111"))
        mi.setValue("010");
    QMapIterator<QString,QString> modi(map);
    qDebug() << " ";
    for(;modi.hasNext();)
        qDebug() << " " << modi.key() << " " << modi.next().value();
#else
    QMap<QString,QString>::const_iterator i;

    for(i = map.constBegin(); i != map.constEnd(); ++i)
        qDebug() << " " << i.key() << " " << i.value();
    QMap<QString,QString>::iterator mi;
    mi = map.find("beijing");
    if(mi != map.end())
    {
        mi.value() = "010";
    }

    QMap<QString,QString>::const_iterator modi;
    qDebug() << " ";
    for(modi = map.constBegin(); modi != map.constEnd(); ++modi)
        qDebug() << " " << modi.key() << " " << modi.value();
#endif

    return 0;
}
